* remove qtci which hasn't been used for a long time.
* remove another obsolete qtci file.
* remove another qtci reference.
* delete obsolete travis build code.
* rename osx install script
* catch ci up with osx travis install script renames.
* remove obsolete debug code from qtio installer.
- "reference/**"
- "shapelib/**"
- "strptime/**"
- - "tools/qtci/README.md"
- "tools/uploadtool/README.md"
- "zlib/**"
- name: Qt install
if: steps.cache.outputs.cache-hit != 'true'
env:
- TRAVIS_BUILD_DIR: ${{ github.workspace }}
+ CI_BUILD_DIR: ${{ github.workspace }}
run: |
- ./tools/travis_install_osx ${{ matrix.QT_VERSION }} aqt
+ ./tools/ci_install_osx.sh ${{ matrix.QT_VERSION }} aqt
- name: Brew install
if: matrix.GENERATOR == 'Ninja'
+++ /dev/null
-# this file is used to build the image gpsbabel_build_environment used by travis.
-
-FROM ubuntu:bionic as qt_install_prep
-WORKDIR /app
-
-# update environment.
-ARG DEBIAN_FRONTEND=noninteractive
-RUN apt-get update && apt-get install -y --no-install-recommends \
- apt-utils \
- && apt-get upgrade -y \
- && rm -rf /var/lib/apt/lists/*
-
-# install packages needed to install Qt
-RUN apt-get update && apt-get install -y --no-install-recommends \
- libdbus-1-3 \
- libfreetype6 \
- libfontconfig1 \
- libx11-6 \
- libx11-xcb1 \
- libxext6 \
- libxkbcommon0 \
- libxkbcommon-x11-0 \
- libxrender1 \
- ca-cacert \
- wget \
- && rm -rf /var/lib/apt/lists/*
-
-FROM qt_install_prep as qt_install
-# basic build and test tools
-ARG INSTALLER
-ARG QT_CI_PACKAGES
-ARG QT_VERSION
-COPY ./extract-qt-installer ./qt-install.qs ./$INSTALLER /app/
-RUN ./extract-qt-installer $INSTALLER /opt/Qt \
- && rm ./extract-qt-installer ./qt-install.qs ./$INSTALLER \
- && echo "export PATH=/opt/Qt/$QT_VERSION/gcc_64/bin:$PATH" > /opt/qt-$QT_VERSION.env
-
-FROM ubuntu:bionic
-LABEL maintainer="https://github.com/tsteven4"
-WORKDIR /app
-ARG QT_VERSION
-
-# update environment.
-# bionic needs a newer git than provided by ubuntu:bionic
-ARG DEBIAN_FRONTEND=noninteractive
-RUN apt-get update && apt-get install -y --no-install-recommends \
- apt-utils \
- software-properties-common \
- && apt-get upgrade -y \
- && add-apt-repository ppa:git-core/ppa \
- && rm -rf /var/lib/apt/lists/*
-
-# install packages needed for gpsbabel build
-# split into multiple commands to limit layer size
-
-# basic build and test tools
-RUN apt-get update && apt-get install -y --no-install-recommends \
- g++ \
- make \
- autoconf \
- git \
- valgrind \
- expat \
- libxml2-utils \
- bear \
- cmake \
- ninja-build \
- && rm -rf /var/lib/apt/lists/*
-
-# alternative compiler
-RUN apt-get update && apt-get install -y --no-install-recommends \
- clang \
- && rm -rf /var/lib/apt/lists/*
-
-# pkgs needed to build document
-RUN apt-get update && apt-get install -y --no-install-recommends \
- fop \
- xsltproc \
- docbook-xml \
- docbook-xsl \
- && rm -rf /var/lib/apt/lists/*
-
-# pkgs with libraries needed by gpsbabel
-RUN apt-get update && apt-get install -y --no-install-recommends \
- libusb-1.0-0-dev \
- pkg-config \
- libudev-dev \
- && rm -rf /var/lib/apt/lists/*
-
-# dependencies of Qt
-RUN apt-get update && apt-get install -y --no-install-recommends \
- libglib2.0-0 \
- libx11-xcb-dev \
- libglu1-mesa-dev \
- libasound2 \
- libxcomposite1 \
- libxcursor1 \
- && rm -rf /var/lib/apt/lists/*
-
-# Qt
-COPY --from=qt_install /opt/qt-$QT_VERSION.env /opt/qtio.env
-COPY --from=qt_install /opt/Qt/$QT_VERSION /opt/Qt/$QT_VERSION
-COPY --from=qt_install /opt/Qt/Licenses /opt/Qt/Licenses
-
-# pkgs needed to generate coverage report:
-RUN apt-get update && apt-get install -y --no-install-recommends \
- gcovr \
- && rm -rf /var/lib/apt/lists/*
-
-# install environment for locale test
-RUN apt-get update && apt-get install -y --no-install-recommends \
- locales \
- && rm -rf /var/lib/apt/lists/* \
- && sed -i 's/^# *\(en_US ISO-8859-1\)/\1/' /etc/locale.gen \
- && locale-gen \
- && locale -a
--- /dev/null
+#!/bin/bash -ex
+#
+# This script is run on travis for the install stage of mac builds.
+#
+
+function version_ge() { test "$(printf "%s\n%s" "$1" "$2" | sort -rV | head -n 1)" == "$1"; }
+
+#debug failed install
+function debug() {
+ cat "${CACHEDIR}/qt-${QT_VERSION}.env"
+ find "${CACHEDIR}" -maxdepth 3 -ls
+ echo "$1" >&2
+ exit 1
+}
+
+# validate install
+function validate() {
+ (
+ set +e
+ # shellcheck source=/dev/null
+ source "${CACHEDIR}/qt-${QT_VERSION}.env"
+ if [ "$(qmake -query QT_INSTALL_BINS)" != "${QTDIR}/bin" ]; then
+ debug "ERROR: unexpected Qt location."
+ fi
+ if [ "$(qmake -query QT_VERSION)" != "${QT_VERSION}" ]; then
+ debug "ERROR: wrong Qt version."
+ fi
+ )
+}
+
+QT_VERSION=${1:-6.2.4}
+METHOD=${2:-aqt}
+
+# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
+CACHEDIR=${HOME}/Cache
+if [ "$METHOD" = "aqt" ]; then
+ if version_ge "${QT_VERSION}" 6.1.2; then
+ QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/macos
+ else
+ QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/clang_64
+ fi
+else
+ QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/clang_64
+fi
+
+if [ -d "${QTDIR}/bin" ]; then
+ echo "Using cached Qt."
+else
+ rm -fr "${CACHEDIR}"
+ mkdir -p "${CACHEDIR}"
+ pushd "${CACHEDIR}"
+
+ if [ "$METHOD" = "artifactory" ]; then
+ (
+ # Do not leak keys
+ set +x
+ if [ -z "${ARTIFACTORY_API_KEY}" ]; then
+ echo "An untrusted build cannot load cache from artifactory."
+ echo "A PR from a forked repo will be an untrusted build."
+ echo "The cache can be loaded from a trusted build of the default branch."
+ echo "A PR from the original repo will be trusted, but has it's own cache."
+ echo "However, when that PR is merged it will build cache for the default branch."
+ echo "Also, the cron job should rebuild the cache for the default branch, if necessary,"
+ echo "once that flavor of build in .travis.yml makes it into the default branch."
+ exit 1
+ else
+ archive=qt-${QT_VERSION}-release-macos.tar.xz
+ curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_API_KEY}" "${ARTIFACTORY_BASE_URL}/${archive}" -o "/tmp/${archive}"
+ tar -x -J -f "/tmp/${archive}"
+ echo "export PATH=${QTDIR}/bin:\$PATH" > "${CACHEDIR}/qt-${QT_VERSION}.env"
+ rm -f "/tmp/${archive}"
+ fi
+ )
+ elif [ "$METHOD" = "aqt" ]; then
+ pip3 install aqtinstall>=2.0.0
+ "${CI_BUILD_DIR}/tools/ci_install_qt.sh" mac "${QT_VERSION}" clang_64 "${CACHEDIR}/Qt"
+ echo "export PATH=${QTDIR}/bin:\$PATH" > "${CACHEDIR}/qt-${QT_VERSION}.env"
+ else
+ echo "ERROR: unknown installation method ${METHOD}." >&2
+ exit 1
+ fi
+ popd
+ validate
+fi
"${CI_BUILD_DIR}/tools/ci_install_qt.sh" windows "${QT_VERSION}" "${PACKAGE_SUFFIX}" "${CACHEDIR}/Qt"
echo "export PATH=${QTDIR}/bin:\$PATH" > "${CACHEDIR}/qt.env"
else
- QT_VERSION_SHORT=${QT_VERSION//./}
- QT_VERSION_MAJMIN=${QT_VERSION%.*}
- curl -s -L -o "qt-opensource-windows-x86-${QT_VERSION}.exe" "https://download.qt.io/official_releases/qt/${QT_VERSION_MAJMIN}/${QT_VERSION}/qt-opensource-windows-x86-${QT_VERSION}.exe"
- ls -l ./*.exe
- netsh advfirewall firewall add rule name=dummyupqt dir=out action=block program="$(cygpath -w "${PWD}/qt-opensource-windows-x86-${QT_VERSION}.exe")"
- "${PWD}/qt-opensource-windows-x86-${QT_VERSION}.exe" --verbose --script "${CI_BUILD_DIR}/tools/qtci/qt-install.qs" QTCI_OUTPUT="${CACHEDIR}/Qt" QTCI_PACKAGES="qt.qt5.${QT_VERSION_SHORT}.${PACKAGE_SUFFIX},qt.qt5.${QT_VERSION_SHORT}.qtwebengine"
- netsh advfirewall firewall delete rule name=dummyupqt
- rm "qt-opensource-windows-x86-${QT_VERSION}.exe"
- ls "${CACHEDIR}/Qt"
- rm -fr "${CACHEDIR}/Qt/Docs"
- rm -fr "${CACHEDIR}/Qt/Examples"
- rm -fr "${CACHEDIR}/Qt/Tools"
- rm -f "${CACHEDIR}/Qt/MaintenanceTool.*"
- echo "export PATH=${QTDIR}/bin:\$PATH" > "${CACHEDIR}/qt.env"
+ echo "ERROR: unknown installation method ${METHOD}." >&2
+ exit 1
fi
fi
validate
+++ /dev/null
-#!/bin/bash -ex
-# you must be logged into docker for the push to succeed.
-
-#versuffix=${1:+_$1} # tag name must be lower case
-versuffix=_qtio
-tag=$(date -u +%Y%m%dT%H%M%SZ)
-
-QT_VERSION=5.15.2
-QT_VERSION_SHORT=${QT_VERSION//./}
-QT_CI_PACKAGES="qt.qt5.${QT_VERSION_SHORT}.gcc_64,qt.qt5.${QT_VERSION_SHORT}.qtwebengine"
-DOWNLOAD_URL=$(./qtci/find_qt_installer ${QT_VERSION})
-INSTALLER=$(basename $DOWNLOAD_URL)
-TMPDIR=$(mktemp -d)
-
-cp Dockerfile${versuffix} $TMPDIR
-cp ./qtci/extract-qt-installer ./qtci/qt-install.qs $TMPDIR
-wget -nv -c -N -P $TMPDIR ${DOWNLOAD_URL}
-
-docker build --pull --file Dockerfile${versuffix} \
- --target qt_install_prep \
- $TMPDIR
-docker build --pull --file Dockerfile${versuffix} \
- --network none \
- --build-arg INSTALLER=${INSTALLER} \
- --build-arg QT_CI_PACKAGES=${QT_CI_PACKAGES} \
- --build-arg QT_VERSION=${QT_VERSION} \
- --target qt_install \
- $TMPDIR
-docker build --pull --file Dockerfile${versuffix} \
- --build-arg INSTALLER=${INSTALLER} \
- --build-arg QT_CI_PACKAGES=${QT_CI_PACKAGES} \
- --build-arg QT_VERSION=${QT_VERSION} \
- --tag tsteven4/gpsbabel_build_environment${versuffix}:latest \
- --tag tsteven4/gpsbabel_build_environment${versuffix}:$tag \
- $TMPDIR
-/bin/rm -fr $TMPDIR
-docker push tsteven4/gpsbabel_build_environment${versuffix}:$tag
-docker push tsteven4/gpsbabel_build_environment${versuffix}:latest
-docker image ls
+++ /dev/null
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+++ /dev/null
-The files extract-qt-installer, install-qt, qt-install.qs, LICENSE, and README.md are from https://github.com/benlau/qtci
+++ /dev/null
-# QT-CI
-This project collects a set of script for building Qt application for Android/iOS in command line environment.
-
-[](https://travis-ci.org/benlau/qtci)
-
-Check [.travis.yml](https://github.com/benlau/qtci/blob/master/.travis.yml) to see how it works.
-It will demonstrate how to build an apk file using QT-CI scripts.
-
-Installation
-============
-
-Since this project is a collection of scripts, and the script in the bin folder does not have any dependence on each other.
-It is not necessary to clone/download the whole repository into your build environment.
-You may simply copy the script you need from this repository.
-
-**recipes/install-qt**
-
-To automatically install Qt, you can just download 2 scripts and grant them permission for execution.
-
-"recipes/install-qt"
-"bin/extract-qt-installer"
-
-Then just run script "recipes/install-qt" with the desired version of Qt
-Example:
-
- bash install-qt 5.9.4
-
-Enviroument variables
-=====================
-
-QT_CI_PACKAGES - packages to install. You can check available packages if set VERBOSE to 1.
-
-Example:
-
- export VERBOSE=1
- export QT_CI_PACKAGES=qt,qt.594,qt.594.gcc_64,qt.594.doc.qtvirtualkeyboard
-
-Setup
-=====
-
- git clone https://github.com/benlau/qtci.git
-
- source qtci/path.env #Add qtci/bin and qtci/recipes to $PATH
-
-
-Script
-======
-
-**(1) bin/extract-qt-installer**
---------------------------------
-
-Usage
-
-```
- extract-qt-installer [--disable-progress-report] qt-installer output_path
- extract-qt-installer --list-packages qt-installer
-```
-
-Extract Qt from the installer to the target path (for Qt 5.5 or above). If --list-packages is given, it will show the available packages from the installer and terminate immediately.
-
-Example:
-
- extract-qt-installer qt-opensource-linux-x64-android-5.5.1.run ~/Qt
-
-**Remarks: The installation path must be absolute path**
-
-Environment Variables
-
- VERBOSE [Optional] Set to "true" will enable VERBOSE output
- QT_CI_PACKAGES [Optional] Select the components to be installed instead of using default (eg. QT_CI_PACKAGES="qt.59.gcc_64")
- QT_CI_LOGIN [Optional] The login name
- QT_CI_PASSWORD [Optional] The password of login
-
-The arguments and environment required could be different due to the installer changes. Check the recipes folder or the wiki of known issues to find out the correct setting.
-
-**(2) bin/extract-ifw**
---------------------------------
-
-Extract installer of "Qt installer framework" to the target path
-
-Example:
-
- extract-ifw qt-installer-framework-opensource-1.5.0-x64.run ~/QtIfw
-
-**(3) bin/install-android-sdk**
---------------------------------
-
-Download and install Android SDK
-
-Example:
-
- install-android-sdk platform-tool,build-tools-20.0.0,android-19
-
-**(4) bin/build-android-gradle-project**
---------------------------------
-
-Build a Qt Android project and sign the APK
-
-Usage:
-
- build-android-gradle-project project.pro
-
-Required Environment Variables
-
- QT_HOME [Required] The home directory of installed Qt. (e.g., ~/Qt/5.7)
- KEYSTORE [Optional] The location of keystore. If it is set, it will be used to sign the created apk
- KEYALIAS [Optional] The alias of the keystore
- KEYPASS [Optional] The password of keystore.
- ANDROID_TARGET_SDK_VERSION [Optional] Target Android SDK version. The default value is "19"
-
-(5) bin/increase-android-version-code
---------------------------------
-
-Usage
-
- increase-android-version-code AndroidManifest.xml
-
-Given an AndroidManifest.xml file, it will increase the value of the versionCode field by one.
-
-(6) bin/run-unittests
-----------------------
-
-Usage
-
- run-unittests project.pro
-
-Build and run a unit test project in the current folder. If qpm.json were found, it would call `qpm install` first.
-
-Recipes
-=======
-
-
-In the folder "recipes", it contains a set of script that could download and install specific Qt toolchains for a different environment. (Include Android)
-
-Please feel free to modify and submit a new recipe.
-
-Example
-
- apt-get install openjdk-8-jdk p7zip
-
- source path.env #Add $PWD/bin and $PWD/recipes to $PATH
-
- #Change to the installation path
-
- qt-5.5.1-android-19 # Install Qt 5.5.1 and Android SDK
-
- source qt-5.5.1-android-19.env # Add installed Qt path to $PATH
-
-
-Reference
-=========
-
- 1. [Continuous distribution for Qt applications on desktop and mobile](http://www.slidedeck.io/lasconic/qtci-qtcon2016)
- 1. [Andrew's Articles - Continuous deployment for Qt applications](http://andrewdolby.com/articles/2016/continuous-deployment-for-qt-applications/)
-
-Related Projects
-=================
-
- 1. [benlau/quickpromise](https://github.com/benlau/quickpromise) - Promise library for QML
- 2. [benlau/quickcross](https://github.com/benlau/quickcross) - QML Cross Platform Utility Library
- 3. [benlau/qsyncable](https://github.com/benlau/qsyncable) - Synchronize data between models
- 4. [benlau/testable](https://github.com/benlau/testable) - QML Unit Test Utilities
- 5. [benlau/quickflux](https://github.com/benlau/quickflux) - Message Dispatcher / Queue for Qt/QML
- 6. [benlau/biginteger](https://github.com/benlau/biginteger) - QML BigInteger library
+++ /dev/null
-#!/bin/bash
-# QT-CI Project
-# License: Apache-2.0
-# https://github.com/benlau/qtci
-
-function usage() {
- echo "Usage:"
- echo "extract-qt-installer qt-installer output_path"
- echo "extract-qt-installer --list-packages qt-installer"
- exit -1
-}
-
-LIST_PACKAGES=0
-
-getopt --test > /dev/null 2>&1
-GETOPT_RET_CODE=$?
-
-set -e #quit on error
-
-if [ "$GETOPT_RET_CODE" != "4" ]
-then
- echo "Warning: gnu-getopt is not installed. Long parameter like '--list-package' will not be working. Please install gnu-getopt by 'brew install gnu-getopt'"
-else
-
- OPTS=`getopt -o l --long list-packages --long disable-progress-report -n "extract-qt-installer" -- "$@"`
-
- eval set -- "$OPTS"
-
- while true
- do
- case "$1" in
- --list-packages)
- LIST_PACKAGES=1
- shift;;
- --disable-progress-report)
- DISABLE_PROGRESS_REPORT=1
- shift;;
- --) shift;break;;
- *) shift;;
- esac
- done
-fi
-
-
-export PATH=$PATH:$PWD
-export WORKDIR=$PWD
-INSTALLER=$1
-OUTPUT=$2
-SCRIPT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/qt-install.qs
-PACKAGES=$QT_CI_PACKAGES
-
-if [ $LIST_PACKAGES -gt 0 ]
-then
-
- if [ $# -lt 1 ]
- then
- usage
- fi
-
- OUTPUT="/tmp/Qt"
-
-else
-
- if [ $# -lt 2 ]
- then
- usage
- fi
-
- if [[ ! "${OUTPUT:0:1}" = "/" ]]
- then
- echo output path must be an absolute path
- exit -1
- fi
-
-fi
-
-
-chmod u+x $1
-if [ -n "$QT_CI_DEBUG" ]
-then
- $INSTALLER -v --script $SCRIPT QTCI_LIST_PACKAGES="$LIST_PACKAGES" QTCI_PACKAGES="$PACKAGES" QTCI_OUTPUT="$OUTPUT" | grep "\(QTCI\|operation\)"
- exit 0
-fi
-
-unset DISPLAY
-
-# platform minimal doesn't work on macos 10.14, 10.15. It did work on 10.13.
-# https://bugreports.qt.io/browse/QTIFW-1471
-PLATFORM="--platform minimal"
-if [ "$(uname)" = "Darwin" ]; then
- vn=$(sw_vers -productVersion | cut -d. -f2,2)
- if [ $vn -ge 14 ]; then
- unset PLATFORM
- fi
-fi
-
-if [ -n "$DISABLE_PROGRESS_REPORT" ]
-then
- $INSTALLER $PLATFORM --script $SCRIPT QTCI_LIST_PACKAGES="$LIST_PACKAGES" QTCI_PACKAGES="$PACKAGES" QTCI_OUTPUT="$OUTPUT"
-else
- if [ -n "$VERBOSE" ]
- then
- $INSTALLER --verbose $PLATFORM --script $SCRIPT QTCI_LIST_PACKAGES="$LIST_PACKAGES" QTCI_PACKAGES="$PACKAGES" QTCI_OUTPUT="$OUTPUT"
- else
- $INSTALLER --verbose $PLATFORM --script $SCRIPT QTCI_LIST_PACKAGES="$LIST_PACKAGES" QTCI_PACKAGES="$PACKAGES" QTCI_OUTPUT="$OUTPUT" | grep "\(QTCI\|operation\)"
- fi
-fi
-
-
+++ /dev/null
-#!/bin/bash -e
-# Reference:
-# https://github.com/musescore/MuseScore/blob/master/build/travis/job_macos/install.sh
-
-QT_VERSION=${1:-5.12.0}
-
-QT_MAJOR_VERSION=$(echo ${QT_VERSION} | cut -d "." -f 1)
-QT_MINOR_VERSION=$(echo ${QT_VERSION} | cut -d "." -f 2)
-if [ "$(uname)" = "Darwin" ]; then
- if { [ "${QT_MAJOR_VERSION}" -eq 5 ] && [ "${QT_MINOR_VERSION}" -ge 9 ]; } || [ "${QT_MAJOR_VERSION}" -ge 6 ]; then
- # this was good from 5.9.0 through at least 5.12.0
- DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${QT_VERSION}/qt-opensource-mac-x64-${QT_VERSION}.dmg
- else
- # this was good from 5.2.1 through 5.8.0
- DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${QT_VERSION}/qt-opensource-mac-x64-clang-${QT_VERSION}.dmg
- fi
-elif [ "$(uname)" = "Linux" ]; then
- # this was good from 5.2.1 through at least 5.12.0
- DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${QT_VERSION}/qt-opensource-linux-x64-${QT_VERSION}.run
-else
- echo "Unsupported system." >&2
- exit 1
-fi
-echo $DOWNLOAD_URL
+++ /dev/null
-#!/bin/bash -e
-# Reference:
-# https://github.com/musescore/MuseScore/blob/master/build/travis/job_macos/install.sh
-
-QT_VERSION=${1:-5.12.0}
-QT_TARGET_CATALOG=${2:-$PWD}
-QT_CI_DOWNLOADER=${QT_CI_DOWNLOADER:-"wget -c -N"}
-
-QT_MAJOR_VERSION=$(echo ${QT_VERSION} | cut -d "." -f 1)
-QT_MINOR_VERSION=$(echo ${QT_VERSION} | cut -d "." -f 2)
-if [ "$(uname)" = "Darwin" ]; then
- if { [ "${QT_MAJOR_VERSION}" -eq 5 ] && [ "${QT_MINOR_VERSION}" -ge 9 ]; } || [ "${QT_MAJOR_VERSION}" -ge 6 ]; then
- # this was good from 5.9.0 through at least 5.12.0
- DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${QT_VERSION}/qt-opensource-mac-x64-${QT_VERSION}.dmg
- else
- # this was good from 5.2.1 through 5.8.0
- DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${QT_VERSION}/qt-opensource-mac-x64-clang-${QT_VERSION}.dmg
- fi
- COMPILER=clang_64
-elif [ "$(uname)" = "Linux" ]; then
- # this was good from 5.2.1 through at least 5.12.0
- DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${QT_VERSION}/qt-opensource-linux-x64-${QT_VERSION}.run
- COMPILER=gcc_64
-else
- echo "Unsupported system." >&2
- exit 1
-fi
-INSTALLER=$(basename $DOWNLOAD_URL)
-ENVFILE=${QT_TARGET_CATALOG}/qt-${QT_VERSION}.env
-
-echo Downloading Qt
-${QT_CI_DOWNLOADER} ${DOWNLOAD_URL} || exit 1
-
-echo Installing Qt
-if [ "$(uname)" = "Darwin" ]; then
- INSTALLER_NAME=${INSTALLER%.*}
- APPFILE=/Volumes/${INSTALLER_NAME}/${INSTALLER_NAME}.app/Contents/MacOS/${INSTALLER_NAME}
- hdiutil attach ${PWD}/${INSTALLER}
- sandbox-exec -n no-network extract-qt-installer $APPFILE ${QT_TARGET_CATALOG}/Qt
- # workaround apparent exit of extract-qt-installer before finished,
- # which results in hdiutil "hdiutil: couldn't unmount "disk1" - Resource busy"
- # and the install resources not being available.
- #hdiutil detach /Volumes/${INSTALLER_NAME}
- count=0
- until hdiutil detach /Volumes/${INSTALLER_NAME} || [ $count -ge 12 ]
- do
- echo "Wait and attempt to detach again"
- count=`expr $count + 1`
- sleep 5
- done
-elif [ "$(uname)" = "Linux" ]; then
- unshare -r -n extract-qt-installer ${PWD}/${INSTALLER} ${QT_TARGET_CATALOG}/Qt
-fi
-
-echo Create ${ENVFILE}
-if [ -d "${QT_TARGET_CATALOG}/Qt/${QT_VERSION}/${COMPILER}/bin" ]; then
- echo "export PATH=${QT_TARGET_CATALOG}/Qt/${QT_VERSION}/${COMPILER}/bin:$PATH" > ${ENVFILE}
-elif [ -d "${QT_TARGET_CATALOG}/Qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${COMPILER}/bin" ]; then
- # some packages use an abbreviated version x.y in the path instead of x.y.z
- echo "export PATH=${QT_TARGET_CATALOG}/Qt/${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}/${COMPILER}/bin:$PATH" > ${ENVFILE}
-fi
-
+++ /dev/null
-#!/bin/bash -e
-# Install Qt by online installer
-
-function usage() {
- echo "Usage:"
- echo "install-qt-online \"packages\" [output_path [qt_installer_version]]"
- echo "Examples:"
- echo "install-qt-online \"qt.qt5.5121.gcc_64\""
- echo "install-qt-online \"qt.qt5.5121.gcc_64\" /opt/Qt"
- echo "install-qt-online \"qt.qt5.5121.gcc_64\" /opt/Qt latest"
- echo "install-qt-online \"qt.qt5.5121.gcc_64\" /opt/Qt 3.1.1"
- exit -1
-}
-
-if [ $# -lt 1 ]
-then
- usage
-fi
-
-export QT_CI_PACKAGES=${1}
-QT_TARGET_CATALOG=${2:-$PWD}
-INSTALLER_VERSION=${3:-latest} # lastest or a version triplet, e.g. 3.1.1
-QT_CI_DOWNLOADER=${QT_CI_DOWNLOADER:-"wget -c -N"}
-
-if [ "$(uname)" = "Darwin" ]; then
- if [ "${INSTALLER_VERSION}" = "latest" ]; then
- DOWNLOAD_URL=https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg
- else
- DOWNLOAD_URL=https://download.qt.io/archive/online_installers/$(echo ${INSTALLER_VERSION} | cut -d . -f1-2)/qt-unified-mac-x64-${INSTALLER_VERSION}-online.dmg
- fi
- COMPILER=clang_64
-elif [ "$(uname)" = "Linux" ]; then
- if [ "${INSTALLER_VERSION}" = "latest" ]; then
- DOWNLOAD_URL=https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
- else
- DOWNLOAD_URL=https://download.qt.io/archive/online_installers/$(echo ${INSTALLER_VERSION} | cut -d . -f1-2)/qt-unified-linux-x64-${INSTALLER_VERSION}-online.run
- fi
- COMPILER=gcc_64
-else
- echo "Unsupported system." >&2
- exit 1
-fi
-
-INSTALLER=$(basename $DOWNLOAD_URL)
-
-echo Downloading Qt
-${QT_CI_DOWNLOADER} ${DOWNLOAD_URL} || exit 1
-
-echo Installing Qt
-
-if [ "$(uname)" = "Darwin" ]; then
- hdiutil attach ${PWD}/${INSTALLER} -plist > minfo.plist
- MOUNTPOINT=$(/usr/libexec/PlistBuddy -c "Print :system-entities:0:mount-point" minfo.plist || \
- /usr/libexec/PlistBuddy -c "Print :system-entities:1:mount-point" minfo.plist || \
- /usr/libexec/PlistBuddy -c "Print :system-entities:2:mount-point" minfo.plist)
- INSTALLER_NAME=$(basename "${MOUNTPOINT}")
- APPFILE="${MOUNTPOINT}"/${INSTALLER_NAME}.app/Contents/MacOS/${INSTALLER_NAME}
- extract-qt-installer "$APPFILE" "${QT_TARGET_CATALOG}/Qt"
- hdiutil detach "${MOUNTPOINT}"
-elif [ "$(uname)" = "Linux" ]; then
- extract-qt-installer ${PWD}/${INSTALLER} "${QT_TARGET_CATALOG}/Qt"
-fi
+++ /dev/null
-// QT-CI Project
-// License: Apache-2.0
-// https://github.com/benlau/qtci
-
-function log() {
- var msg = ["QTCI: "].concat([].slice.call(arguments));
- console.log(msg.join(" "));
-}
-
-function printObject(object) {
- var lines = [];
- for (var i in object) {
- lines.push([i, object[i]].join(" "));
- }
- log(lines.join(","));
-}
-
-var status = {
- widget: null,
- finishedPageVisible: false,
- installationFinished: false
-}
-
-function tryFinish() {
- if (status.finishedPageVisible && status.installationFinished) {
- if (status.widget.LaunchQtCreatorCheckBoxForm) {
- // Disable this checkbox for minimal platform
- status.widget.LaunchQtCreatorCheckBoxForm.launchQtCreatorCheckBox.setChecked(false);
- }
- if (status.widget.RunItCheckBox) {
- // LaunchQtCreatorCheckBoxForm may not work for newer versions.
- status.widget.RunItCheckBox.setChecked(false);
- }
- log("Press Finish Button");
- gui.clickButton(buttons.FinishButton);
- }
-}
-
-function Controller() {
- installer.installationFinished.connect(function() {
- status.installationFinished = true;
- gui.clickButton(buttons.NextButton);
- tryFinish();
- });
- installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
- installer.setMessageBoxAutomaticAnswer("installationErrorWithRetry", QMessageBox.Ignore);
- installer.setMessageBoxAutomaticAnswer("XcodeError", QMessageBox.Ok);
-
- // Allow to cancel installation for arguments --list-packages
- installer.setMessageBoxAutomaticAnswer("cancelInstallation", QMessageBox.Yes);
-}
-
-Controller.prototype.WelcomePageCallback = function() {
- log("Welcome Page");
-
- gui.clickButton(buttons.NextButton);
-
- var widget = gui.currentPageWidget();
-
- /*
- Online installer 3.0.6
- - It must disconnect the completeChanged callback after used, otherwise it will click the 'next' button on another pages
- */
- var callback = function() {
- gui.clickButton(buttons.NextButton);
- widget.completeChanged.disconnect(callback);
- }
-
- widget.completeChanged.connect(callback);
-}
-
-Controller.prototype.CredentialsPageCallback = function() {
-
- var login = installer.environmentVariable("QT_CI_LOGIN");
- var password = installer.environmentVariable("QT_CI_PASSWORD");
-
- if (login === "" || password === "") {
- gui.clickButton(buttons.CommitButton);
- }
-
- var widget = gui.currentPageWidget();
-
- widget.loginWidget.EmailLineEdit.setText(login);
-
- widget.loginWidget.PasswordLineEdit.setText(password);
-
- gui.clickButton(buttons.CommitButton);
-}
-
-Controller.prototype.ComponentSelectionPageCallback = function() {
- log("ComponentSelectionPageCallback");
-
- function list_packages() {
- var components = installer.components();
- log("Available components: " + components.length);
- var packages = ["Packages: "];
-
- for (var i = 0; i < components.length; i++) {
- packages.push(components[i].name);
- }
- log(packages.join(" "));
- }
-
- var widget = gui.currentPageWidget();
-
- var archiveCheckBox = gui.findChild(widget, "Archive");
- var latestCheckBox = gui.findChild(widget, "Latest releases");
- var fetchButton = gui.findChild(widget, "FetchCategoryButton");
-
- if (archiveCheckBox != null) {
- // check archive
- archiveCheckBox.click();
- }
- if (latestCheckBox != null) {
- // uncheck latest
- latestCheckBox.click();
- }
- if (fetchButton != null) {
- fetchButton.click()
- }
-
- if (installer.value("QTCI_LIST_PACKAGES", "0") != "0") {
- list_packages();
- gui.clickButton(buttons.CancelButton);
- return;
- }
-
- log("Select components");
-
- function trim(str) {
- return str.replace(/^ +/, "").replace(/ *$/, "");
- }
-
- var packages = trim(installer.value("QTCI_PACKAGES")).split(",");
- if (packages.length > 0 && packages[0] !== "") {
- widget.deselectAll();
- var components = installer.components();
- var allfound = true;
- for (var i in packages) {
- var pkg = trim(packages[i]);
- var found = false;
- for (var j in components) {
- if (components[j].name === pkg) {
- found = true;
- break;
- }
- }
- if (!found) {
- allfound = false;
- log("ERROR: Package " + pkg + " not found.");
- } else {
- log("Select " + pkg);
- widget.selectComponent(pkg);
- }
- }
- if (!allfound) {
- list_packages();
- // TODO: figure out how to set non-zero exit status.
- gui.clickButton(buttons.CancelButton);
- return;
- }
- } else {
- log("Use default component list");
- }
-
- gui.clickButton(buttons.NextButton);
-}
-
-Controller.prototype.IntroductionPageCallback = function() {
- log("Introduction Page");
- log("Retrieving meta information from remote repository");
-
- /*
- Online installer 3.0.6
- - Don't click buttons.NextButton directly. It will skip the componenet selection.
- */
-
- if (installer.isOfflineOnly()) {
- gui.clickButton(buttons.NextButton);
- }
-}
-
-Controller.prototype.TargetDirectoryPageCallback = function() {
- var output = installer.value("QTCI_OUTPUT");
- log("Set target installation page: " + output);
- var widget = gui.currentPageWidget();
-
- if (widget != null) {
- widget.TargetDirectoryLineEdit.setText(output);
- }
-
- gui.clickButton(buttons.NextButton);
-}
-
-Controller.prototype.LicenseAgreementPageCallback = function() {
- log("Accept license agreement");
- var widget = gui.currentPageWidget();
-
- if (widget != null) {
- widget.AcceptLicenseRadioButton.setChecked(true);
- }
-
- gui.clickButton(buttons.NextButton);
-}
-
-Controller.prototype.ReadyForInstallationPageCallback = function() {
- log("Ready to install");
-
- // Bug? If commit button pressed too quickly finished callback might not show the checkbox to disable running qt creator
- // Behaviour started around 5.10. You don't actually have to press this button at all with those versions, even though gui.isButtonEnabled() returns true.
- gui.clickButton(buttons.CommitButton, 200);
-}
-
-Controller.prototype.PerformInstallationPageCallback = function() {
- log("PerformInstallationPageCallback");
- gui.clickButton(buttons.CommitButton);
-}
-
-Controller.prototype.FinishedPageCallback = function() {
- log("FinishedPageCallback");
-
- var widget = gui.currentPageWidget();
-
- // Bug? Qt 5.9.5 and Qt 5.9.6 installer show finished page before the installation completed
- // Don't press "finishButton" immediately
- status.finishedPageVisible = true;
- status.widget = widget;
- tryFinish();
-}
-
-// Telemetry disabled
-Controller.prototype.DynamicTelemetryPluginFormCallback = function()
-{
- log("TelemetryPluginFormCallback");
- var page = gui.pageWidgetByObjectName("DynamicTelemetryPluginForm");
- page.statisticGroupBox.disableStatisticRadioButton.setChecked(true);
- gui.clickButton(buttons.NextButton);
-}
-
-// On windows installs there is a page about the start menu.
-Controller.prototype.StartMenuDirectoryPageCallback = function() {
- log("StartMenuDirectoryPageCallback");
- gui.clickButton(buttons.NextButton);
-}
-
-// qt online installer 3.2.1: open source users must now accept the open
-// source obligations.
-// https://www.qt.io/blog/qt-online-installer-3.2.1-released
-Controller.prototype.ObligationsPageCallback = function()
-{
- log("ObligationsPageCallback");
- var page = gui.pageWidgetByObjectName("ObligationsPage");
- page.obligationsAgreement.setChecked(true);
- page.completeChanged();
- gui.clickButton(buttons.NextButton);
-}
+++ /dev/null
-#!/bin/bash -ex
-#
-# This script is run on travis for the install stage of mac builds.
-#
-
-#debug failed install
-function debug() {
- cat ${CACHEDIR}/qt-${QT_VERSION}.env
- find ${CACHEDIR}/Qt -maxdepth 3 -ls
- cat ${CACHEDIR}/Qt/InstallationLog.txt
- cat ${CACHEDIR}/Qt/components.xml
- echo "$1" >&2
- exit 1
-}
-
-# validate install
-function validate() {
- (
- set +e
- source ${CACHEDIR}/qt-${QT_VERSION}.env
- if [ "$(qmake -query QT_INSTALL_BINS)" != "${QTDIR}/bin" ]; then
- debug "ERROR: unexpected Qt location."
- fi
- if [ "$(qmake -query QT_VERSION)" != "${QT_VERSION}" ]; then
- debug "ERROR: wrong Qt version."
- fi
- )
-}
-
-QT_VERSION=${1:-5.15.2}
-QT_VERSION_SHORT=${QT_VERSION//./}
-
-# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
-CACHEDIR=${HOME}/Cache
-QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/gcc_64
-
-if [ -d "${QTDIR}/bin" ]; then
- echo "Using cached Qt."
- echo "If you need to clear the cache see"
- echo "https://docs.travis-ci.com/user/caching/#Fetching-and-storing-caches."
-else
- rm -fr ${CACHEDIR}
- mkdir -p ${CACHEDIR}
- QT_CI_DOWNLOADER="wget -nv -c" PATH=${TRAVIS_BUILD_DIR}/tools/qtci:${PATH} install-qt-online "qt.qt5.${QT_VERSION_SHORT}.gcc_64" ${CACHEDIR}
- echo "export PATH=${QTDIR}/bin:$PATH" > ${CACHEDIR}/qt-${QT_VERSION}.env
- validate
-fi
+++ /dev/null
-#!/bin/bash -ex
-#
-# This script is run on travis for the install stage of mac builds.
-#
-
-#debug failed install
-function debug() {
- cat ${CACHEDIR}/qt-${QT_VERSION}.env
- find ${CACHEDIR}/Qt -maxdepth 3 -ls
- cat ${CACHEDIR}/Qt/InstallationLog.txt
- cat ${CACHEDIR}/Qt/components.xml
- echo "$1" >&2
- exit 1
-}
-
-# validate install
-function validate() {
- (
- set +e
- source ${CACHEDIR}/qt-${QT_VERSION}.env
- if [ "$(qmake -query QT_INSTALL_BINS)" != "${QTDIR}/bin" ]; then
- debug "ERROR: unexpected Qt location."
- fi
- if [ "$(qmake -query QT_VERSION)" != "${QT_VERSION}" ]; then
- debug "ERROR: wrong Qt version."
- fi
- )
-}
-
-QT_VERSION=${1:-5.15.2}
-QT_VERSION_SHORT=${QT_VERSION//./}
-
-# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
-CACHEDIR=${HOME}/Cache
-QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/gcc_64
-
-if [ -d "${QTDIR}/bin" ]; then
- echo "Using cached Qt."
- echo "If you need to clear the cache see"
- echo "https://docs.travis-ci.com/user/caching/#Fetching-and-storing-caches."
- if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
- # the cache is being used. modify it to reset expiration date.
- date > ${CACHEDIR}/timestamp
- fi
- if [ -f "${CACHEDIR}/timestamp" ]; then
- echo -n "Cache timestamp: "
- cat "${CACHEDIR}/timestamp"
- fi
-else
- rm -fr ${CACHEDIR}
- mkdir -p ${CACHEDIR}
- pushd ${CACHEDIR}
- # install-qt creates the install at $PWD/Qt.
- QT_CI_PACKAGES=qt.qt5.${QT_VERSION_SHORT}.gcc_64,qt.qt5.${QT_VERSION_SHORT}.qtwebengine QT_CI_DOWNLOADER="wget -nv -c" PATH=${TRAVIS_BUILD_DIR}/tools/qtci:${PATH} install-qt ${QT_VERSION}
- popd
- validate
- rm ${CACHEDIR}/qt-opensource*.run
-fi
-
-# prepare locale for test_encoding_latin1, requires locales package.
-sudo rm -rf /var/lib/apt/lists/* \
- && sudo sed -i 's/^# *\(en_US ISO-8859-1\)/\1/' /etc/locale.gen \
- && sudo locale-gen \
- && locale -a
+++ /dev/null
-#!/bin/bash -ex
-#
-# This script is run on travis for the install stage of mac builds.
-#
-
-function version_ge() { test "$(printf "%s\n%s" "$1" "$2" | sort -rV | head -n 1)" == "$1"; }
-
-#debug failed install
-function debug() {
- cat "${CACHEDIR}/qt-${QT_VERSION}.env"
- find "${CACHEDIR}" -maxdepth 3 -ls
- cat "${CACHEDIR}/Qt/InstallationLog.txt"
- cat "${CACHEDIR}/Qt/components.xml"
- echo "$1" >&2
- exit 1
-}
-
-# validate install
-function validate() {
- (
- set +e
- # shellcheck source=/dev/null
- source "${CACHEDIR}/qt-${QT_VERSION}.env"
- if [ "$(qmake -query QT_INSTALL_BINS)" != "${QTDIR}/bin" ]; then
- debug "ERROR: unexpected Qt location."
- fi
- if [ "$(qmake -query QT_VERSION)" != "${QT_VERSION}" ]; then
- debug "ERROR: wrong Qt version."
- fi
- )
-}
-
-QT_VERSION=${1:-6.2.4}
-METHOD=${2:-aqt}
-
-# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
-CACHEDIR=${HOME}/Cache
-if [ "$METHOD" = "aqt" ]; then
- if version_ge "${QT_VERSION}" 6.1.2; then
- QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/macos
- else
- QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/clang_64
- fi
-else
- QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/clang_64
-fi
-
-if [ -d "${QTDIR}/bin" ]; then
- echo "Using cached Qt."
- echo "If you need to clear the cache see"
- echo "https://docs.travis-ci.com/user/caching/#Fetching-and-storing-caches."
- if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
- # the cache is being used. modify it to reset expiration date.
- date > "${CACHEDIR}/timestamp"
- fi
- if [ -f "${CACHEDIR}/timestamp" ]; then
- echo -n "Cache timestamp: "
- cat "${CACHEDIR}/timestamp"
- fi
-else
- rm -fr "${CACHEDIR}"
- mkdir -p "${CACHEDIR}"
- pushd "${CACHEDIR}"
-
- if [ "$METHOD" = "artifactory" ]; then
- (
- # Do not leak keys
- set +x
- if [ -z "${ARTIFACTORY_API_KEY}" ]; then
- echo "An untrusted build cannot load cache from artifactory."
- echo "A PR from a forked repo will be an untrusted build."
- echo "The cache can be loaded from a trusted build of the default branch."
- echo "A PR from the original repo will be trusted, but has it's own cache."
- echo "However, when that PR is merged it will build cache for the default branch."
- echo "Also, the cron job should rebuild the cache for the default branch, if necessary,"
- echo "once that flavor of build in .travis.yml makes it into the default branch."
- exit 1
- else
- archive=qt-${QT_VERSION}-release-macos.tar.xz
- curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_API_KEY}" "${ARTIFACTORY_BASE_URL}/${archive}" -o "/tmp/${archive}"
- tar -x -J -f "/tmp/${archive}"
- echo "export PATH=${QTDIR}/bin:\$PATH" > "${CACHEDIR}/qt-${QT_VERSION}.env"
- rm -f "/tmp/${archive}"
- fi
- )
- elif [ "$METHOD" = "aqt" ]; then
- pip3 install aqtinstall>=2.0.0
- "${TRAVIS_BUILD_DIR}/tools/ci_install_qt.sh" mac "${QT_VERSION}" clang_64 "${CACHEDIR}/Qt"
- echo "export PATH=${QTDIR}/bin:\$PATH" > "${CACHEDIR}/qt-${QT_VERSION}.env"
- else
- # install-qt creates the install at $PWD/Qt.
- QT_VERSION_SHORT=${QT_VERSION//./}
- QT_CI_PACKAGES=qt.qt5.${QT_VERSION_SHORT}.clang_64,qt.qt5.${QT_VERSION_SHORT}.qtwebengine QT_CI_DOWNLOADER="wget -nv -c" PATH=${TRAVIS_BUILD_DIR}/tools/qtci:${PATH} install-qt "${QT_VERSION}"
- rm "${CACHEDIR}"/qt-opensource*.dmg
- fi
- popd
- validate
-fi